<!--
 * @Author       : archer
 * @Date         : 2021-06-28 10:31:24
 * @LastEditors  : ly
 * @LastEditTime : 2021-08-13 14:53:11
 * @Description  : 自定义菜单引用第三方图标item组件
-->
<script>
  export default {
    name: 'MenuItem',
    functional: true,
    props: {
      type: {
        type: String,
        default: '',
      },
      title: {
        type: String,
        default: '',
      },
    },
    render(h, context) {
      const { type, title } = context.props
      const vnodes = []

      /* if (type) {
        vnodes.push(<medo-icon icon-class={type} />)
      } */

      if (type) {
        if (type != 'point') {
          vnodes.push(<medo-icon style="font-size:0.16rem" icon-class={type} />)
        } else {
          //超赞的解决方案
          vnodes.push(<span class={type}></span>)
        }
      }

      if (title) {
        vnodes.push(<span slot="title">{title}</span>)
      }
      return vnodes
    },
  }
</script>
